package com.example.newspublish.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.example.newspublish.pojo.entity.SysOperLog;
import com.example.newspublish.pojo.form.OperLogQueryForm;
import com.example.newspublish.pojo.result.Result;
import com.example.newspublish.service.OperLogService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name="操作日志")
@RestController
@RequestMapping("/news/operLog")
public class OperLogController {

    @Autowired
    private OperLogService operLogService;

    @GetMapping("{page}/{limit}")
    public Result index(
            @Param(value="页码")
            @PathVariable Long page,
            @Param(value = "每页记录数")
            @PathVariable Long limit,
            @Param(value = "查询对象")
                    OperLogQueryForm operLogQueryForm) {
        IPage<SysOperLog> pageModel = operLogService.selectPage(page,limit,operLogQueryForm);
        return Result.ok(pageModel);
    }

}
